import java.util.*;
public class benchmarkDemo {	
		

		public static void main(String args[]) {
			
			//array list
			long start=System.currentTimeMillis();
			 List<String> arr = new ArrayList<String>();
			    for(int i=0;i<100000;++i){
			        arr.add(Integer.toString(i));
			    }
			    arr.add(9000,"anitha");
			    System.out.println("time taken by array list:"+(System.currentTimeMillis()-start));
			    //linked list
			    long start1=System.currentTimeMillis();
			    List<String> arrL = new LinkedList<String>();
			    for(int i=0;i<5000000;++i){
			        arrL.add(Integer.toString(i));
			    }
			    arrL.add(9000,"anitha");
			    System.out.println( "time taken by linked list:"+(System.currentTimeMillis()-start1) );

		}
	}
